#include "DataPage.h"

DataPage::DataPage(AsyncDBManager* dbManager_) :asyncDBManager(dbManager_)
{
	ui.setupUi(this);
	imageDataTab = std::make_shared<ImageDataTab>(&this->ui);
	detectDataTab = std::make_shared<DetectDataTab>(&this->ui, asyncDBManager);
}

void DataPage::updateCurUserInfo(UserInfo user) {
	curUser = user;
	//updateTabsUserInfo(curUser);
	if (!curUser.isValid()) {
		hasUserLogin = false;
	}
	hasUserLogin = true;
}
void DataPage::updateProducts() {
	detectDataTab->updateProducts();
}